package com.dq.repository.user;

import com.dq.domain.goods.Goods;
import com.dq.domain.sys.user.user.base.SysUser;
import com.dq.domain.sys.user.UserCollection;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author liuhui
 * @date 2019/9/17 0017 10:03:20
 */
@Repository
public interface UserCollectionRepository extends JpaRepository<UserCollection, Long> {

    UserCollection getByUserAndGoods(SysUser user, Goods goods);

    List<UserCollection> findByUser(SysUser user);

    Page<UserCollection> getByUserOrderByCreateTimeDesc(SysUser user, Pageable pageable);

    Long countByUser(SysUser user);
}
